package admin

import database "hft/Database"

type ArticleBase struct {
	database.Base
	Name        string       `json:"title,omitempty"`
	Cover       string       `json:"cover,omitempty" gorm:"type:text"`
	ArtType     int          `json:"group,omitempty" gorm:"index"`
	Author      string       `json:"author"`
	AccountId   uint         `json:"-"`
	AccountLink string       `json:"-"`
	RegionLink  string       `json:"regionLink" gorm:"index"`
	HasImg      bool         `json:"hasImg"`
	HasVideo    bool         `json:"hasVideo"`
	PureText    string       `json:"pure_text" gorm:"type:longtext"` //摘要
	Cont        *ArticleCont `json:"cont,omitempty" gorm:"foreignKey:ArticleId;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE"`
}

func (ArticleBase) TableName() string {
	return database.TableNameFormat("article_base")
}
